// pages/detail-video/detail-video.js
import { getMVUrl,getMVDetail,getMVrelated } from "../../../serive/video"

Page({
    data:{
        id:0,
        videoUrl:"",
        danmuList:[
            { text: "第一条弹幕",color: '#ffffff', time: 3 },
            { text: "第二条弹幕",color: '#fff000', time: 6 },
        ],
        detailData:{}
    },
    async onLoad(options) {
        this.setData({ id: options.id })

        this.fetchMvUrl()
        this.fetchMVDetail()
        this.fetchMVRelated()
    },
    async fetchMvUrl() {
        const res = await getMVUrl(this.data.id)
        this.setData({ videoUrl: res.data.url })
    },
    async fetchMVDetail() {
        const res = await getMVDetail(this.data.id)
        this.setData({ detailData: res.data }) 
    },
    async fetchMVRelated() {
        const res = await getMVrelated(this.data.id)
    }
})